const koaRouter = require('@koa/router')
const { create, remove, update, get, getList, search } = require('../controller/productController.js')
const { verifAuth } = require('../middleware/login.middleware.js')
const productRouter = new koaRouter({ prefix: '/product' })
// 增加
productRouter.post('/', verifAuth, create)
//查

// 根据传入type查询解决方案动态列表,type为路径参数/product/search?type=1
productRouter.get('/search', search)
productRouter.get('/:id', get)
productRouter.get('/', getList)
// // 改
productRouter.post('/:id', verifAuth, update)
// // 删
productRouter.delete('/:id', verifAuth, remove)



module.exports = productRouter
